#include <iostream>
using namespace std;

int A[]={4,8,15,16,23,42};
void printArray(int array[],int size)
{
	if(size>0)
	{
		for(int i=0;i<size;i++)
			cout<<array[i]<<",";
		cout<<endl;
	}
	else
	{
		cout<<"Damn,give me a correct array please"<<endl;
	}
	
	
	
}
void bubllesort(int array[],int size)
{
	for(int i=0;i<size;i++)
	{
		for(int j=(size-1);j>i;j--)
		{	
			if(array[j]<array[j-1])
				swap(array[j],array[j-1]);
		}
	}
}
void swap(int x,int y)
{
	int t=x;
	x=y;
	y=t;
}
int main (int argc, char * const argv[]) {
    int size=(sizeof(A)/sizeof(int));
	cout<<"Array before Bubble Sort"<<endl;
	printArray(A,size);
    bubllesort(A,size);
	cout<<"Array after Bubble Sort"<<endl;
	printArray(A,size);
	return 0;
}
